<template>
  <view class="page-status-bar"></view>
  <view class="page-wrapper page-space">
    <navigator class="demo-navigator" url="/demo/crud/list"><button class="demo-btn">增删改查</button></navigator>
    <navigator class="demo-navigator" url="/demo/dict/index"><button class="demo-btn">数据字典的使用</button></navigator>
    <navigator class="demo-navigator" url="/demo/auth/index"><button class="demo-btn">权限控制</button></navigator>
    <navigator class="demo-navigator" url="/demo/upload/index"><button class="demo-btn">文件上传</button></navigator>

    <view v-if="isLogin">
      登录可见内容
    </view>
    <view v-if="hasRole('admin')">
      有“admin”角色可见内容
    </view>
    <view v-if="hasPermit('/auth/user/create')">
      有“/auth/user/create”权限可见内容
    </view>
  </view>
</template>

<script setup lang="ts">
import {useHasPermit, useHasRole, useIsLogin} from "@/store/account";

const isLogin = useIsLogin();
const hasRole = useHasRole();
const hasPermit = useHasPermit('');
</script>

<style scoped lang="scss">
</style>
